package task;

import java.util.Scanner;

public class Task3_11 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int a = input.nextInt() ;
        int counter = 0;
        /*while(a != 0){
            if(a % 2 == 1) {//不能求负数
                counter++;
                a /= 2;
            } else{
                a /= 2;

            }*/


        while(a != 0){

            counter++;
            a = (a & (a - 1));//每次相与少一个1
                }

                System.out.println(counter);
            }




}
